Aug 30 2006
by Xieon


-----------------------------------------------------------------
  Grand Theft Auto: San Andreas Mission Coding Patch
-----------------------------------------------------------------

   [1].  ?

     -  ,   CyQ  VC 1.0
   (  - http://www.gtaforums.com/index.php?showtopic=217910),
    :        main.scm,
           GTA:SA (   
        -        /  
     ,  (),  , 
    ,     ,  ).

    ,  ""     ,   VC, 
   ..         , 
        (  CyQ    03FD), 
     Access Violation    . ,   
   .          -   
    ,    ,  WinAPI  
   VirtualProtect,  ,     ,   /
      .     -"" (NOP) 
      ,     .



   [2].   ?

      ,       
    EXE ,        ,  "" 
      .



   [3].   .

     ,     "Patch!".     
        ,     ,  
      ".." .
   
     SASCM.INI      (Sanny Builder  SAMB)
      :

   00c3=0,nop
   00c4=0,nop

      :

   00c3=3,read_mem_address %1d% type %2d% value_to %3d%
   00c4=3,write_mem_address %1d% type %2d% value %3d%

       :

   0181=0,nop

     :

   0181=3,virtual_protect_change_at %1d% size %2d% new_protect %3d%

   ,      :)   :

   0181: virtual_protect_change_at 8796548 size 4 new_protect 4
   00C4: write_mem_address 8796548 type 2 value 0.002
   0181: virtual_protect_change_at 8796548 size 4 new_protect -1 

   8796548 (0x863984) -     ,    , 
       ,        :) - , 
           ,    
    0181.



   [4].   .

   00C3, 00C4:

   	    ,       (
                 gtamodding.com       GTAForums,  
               ),        ():

   	0   		(1 )
   	1  		(2 )	
   	2    	(4 )

  	      ,    , 
	,     00C3 - ,    , 
	 .

   0181:

	     VirtualProtect  kernel32.dll,   
	  Win32 API (  -   :)),    ,    ,
	             .

	  ,  ( )    ,   :

   	1 	 PAGE_NOACCESS			( )
   	2 	 PAGE_READONLY
   	4 	 PAGE_READWRITE		(    )
   	8 	 PAGE_WRITECOPY
   	16 	 PAGE_EXECUTE		
   	32 	 PAGE_EXECUTE_READ
   	64 	 PAGE_EXECUTE_READWRITE	(  ,    )	
   	128 	 PAGE_EXECUTE_WRITECOPY
   	256 	 PAGE_GUARD
   	512 	 PAGE_NOCACHE

	   -1 (  ),        .
	         /  
	 set_bit. 

	  4 (PAGE_READWRITE)    -     .


   [5].  readme.

            ,       .

   - ,   ..:    mail@sannybuilder.com

      GTA ! =)

 